package com.qf.feign;

import feign.hystrix.FallbackFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author YDW
 * projectName:project2202_4
 * time:2022/6/14 9:48
 * description:
 */
//@Component
public class MyFallbackFactory implements FallbackFactory<GoodsFeign> {

    @Autowired
   MyFallback myFallback;

    @Override
    public GoodsFeign create(Throwable cause) {
        System.out.println("原因:"+cause);
        cause.printStackTrace();
        return myFallback;
    }
}
